﻿using System;
using System.Data;

#if NET20
namespace System.Net20.Tests
#elif NET35
namespace System.Net35.Tests
#elif NET40
namespace System.Net40.Tests
#elif NET45
namespace System.Net45.Tests
#elif NET451
namespace System.Net451.Tests
#elif PORTABLE40
namespace System.Portable40.Tests
#elif PORTABLE45
namespace System.Portable40.Tests
#endif
{
	public class TestDataItem
	{
		public double UnixTimestampDouble { get; set; }
		public DateTime DateTime { get; set; }
		
		public static TestDataItem FromDataRow(DataRow row)
		{
			return new TestDataItem()
			{
				UnixTimestampDouble = Convert.ToDouble(row["UnixTimestamp"]),
				DateTime = new DateTime(((DateTime)row["DateTime"]).Ticks, DateTimeKind.Utc)
			};
		}

		public long UnixTimestampLong
		{
			get
			{
				return Convert.ToInt64(this.UnixTimestampDouble);
			}
		}

		public long UnixTimestampInt
		{
			get
			{
				return Convert.ToInt64(this.UnixTimestampDouble);
			}
		}
	}
}
